/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util;

import java.sql.Date;

/**
 *
 * @author Tien
 */
public class Validator {

    public static boolean isPositiveNumber(String num) {
        try {
            if (Double.parseDouble(num) > 0) {
                return true;
            }
        } catch (Exception e) {
        }
        return false;
    }
    
    public static boolean isInteger(String num) {
        try {
            if (Integer.parseInt(num) > 0) {
                return true;
            }
        } catch (Exception e) {
        }
        return false;
    }

    public static boolean isDate(String date) {
        try {
            Date.valueOf(date);
            return true;
        } catch (Exception e) {
        }
        return false;
    }
}
